package com.cskaoyan.service.impl;

import com.cskaoyan.bean.CskaoyanmallFeedback;
import com.cskaoyan.mapper.CskaoyanmallFeedbackMapper;
import com.cskaoyan.mapper.CskaoyanmallUserMapper;
import com.cskaoyan.service.WxFeedbackService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

@Service
public class WxFeedbackServiceImpl implements WxFeedbackService {

    @Autowired
    CskaoyanmallFeedbackMapper feedbackMapper;

    @Autowired
    CskaoyanmallUserMapper userMapper;


    @Override
    public void submitFeedback(CskaoyanmallFeedback feedback, Integer userId) {

        feedback.setUserId(userId);

        String userName = userMapper.selectUserNameById(userId);

        feedback.setUsername(userName);
        feedback.setAddTime(new Date());
        feedback.setUpdateTime(new Date());
        feedback.setStatus(0);
        feedback.setDeleted(false);

        feedbackMapper.insertSelective(feedback);



    }
}
